package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        String[] arr = {"one", "tow", "three", "four", "five"};
        for (String s : arr) {
            System.out.println(s);
        }
        Collection<String> c = new ArrayList<>();
        c.add("a");
        c.add("b");
        c.add("c");
        c.add("d");
        c.add("e");
        System.out.println(c);
        for (String s : c) {
            System.out.println(s);
        }

        System.out.println(c);
        Iterator<String> it = c.iterator();
        while (it.hasNext()) {
            String s = it.next();
            System.out.println(s);
        }
    }
}
